package com.bit.demo1;

public class lkt {
    public String name;
    public String gender;
    public int age;
    public double score;
    public static String classRoom = "Bit306";

    public lkt(String name,String gender,int age,double score){}

    // ...
    public static void main(String[] args) {
// 静态成员变量可以直接通过类名访问
        System.out.println(lkt.classRoom);
        lkt s1 = new lkt("Li leilei", "男", 18, 3.8);
        lkt s2 = new lkt("Han MeiMei", "女", 19, 4.0);
        lkt s3 = new lkt("Jim", "男", 18, 2.6);
// 也可以通过对象访问：但是classRoom是三个对象共享的
        System.out.println(s1.classRoom);
        System.out.println(s2.classRoom);
        System.out.println(s3.classRoom);
    }
}
